/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package salarie;

/**
 *
 * @author Gatoper
 */
public class PayTime  implements TPay{
    protected double payRate;
    private int hoursWorked;
//
//    public void setHoursWorked(int hoursWorked) {
//            this.hoursWorked = hoursWorked;
//    }
    
    @Override
    public  double applyLegalDeductions() {
		if (hoursWorked<=48)
			return 0;
		else
			return ((hoursWorked - 48) * payRate) * 0.1;
    }
    @Override
    public double pay(){
        	double payment = (payRate - this.applyLegalDeductions())*hoursWorked - this.applyLegalDeductions();
		hoursWorked = 0;
		return payment;
    }
}



